{extend name="index_layout"/}

{block name="jscss"}

	<script src="admin2/js/jquery.min.js"></script>
	<script src="admin2/js/vue.min.js"></script>
	<script src="admin2/js/MagicCusJSFun.js"></script>
	<script src="admin2/js/HttpRequest.js"></script>
	<script src="admin2/js/libindex.js"></script>
	<link rel="stylesheet" href="admin2/css/reset.css">
	<link rel="stylesheet" href="admin2/css/index.css?time={:time()}">
	<link rel="stylesheet" href="admin2/css/eindex.css">
	</link>

{/block}


{block name="main"}
<body>
	<div id="app">
		<div class="search">

			<div class="item w300">
				<div class="label">
					订单ID
				</div>
				<div class="input">
					<el-input v-model="id" placeholder="请输入内容"></el-input>
				</div>
			</div>


			<div class="item w300">
				<div class="label">
					业务员
				</div>
				<div class="input">
					<el-input v-model="sale" placeholder="请输入内容"></el-input>
				</div>
			</div>


			<div class="item w300">
				<div class="label">
					门店
				</div>
				<div class="input">
					<el-input v-model="shop_name" placeholder="请输入内容"></el-input>
				</div>
			</div>


			<div class="item w300">
				<div class="label">
					客服审核
				</div>
				<div class="input">
					<el-select v-model="kf_status" placeholder="请选择">
						<el-option
								v-for="item in options"
								:key="item.value"
								:label="item.label"
								:value="item.value">
						</el-option>
					</el-select>
				</div>
			</div>

			<div class="item w300">
				<div class="label">
					财务审核
				</div>
				<div class="input">
					<el-select v-model="cw_status" placeholder="请选择">
						<el-option
								v-for="item in options"
								:key="item.value"
								:label="item.label"
								:value="item.value">
						</el-option>
					</el-select>
				</div>
			</div>

			<div class="item w300">
				<div class="label">
					入网号码
				</div>
				<div class="input">
					<el-input v-model="phone" placeholder="请输入内容"></el-input>
				</div>
			</div>

			<div class="item w400">
				<div class="label">
					日期
				</div>
				<div class="input">
					<el-date-picker
							v-model="create_time"
							type="daterange"
							range-separator="至"
							start-placeholder="开始日期"
							end-placeholder="结束日期"
							value-format="yyyy-MM-dd"
					>
					</el-date-picker>
				</div>
			</div>


			<div class="w300" style="padding-top: 10px;padding-left: 8px;">
				<el-button type="primary" @click="search">搜索</el-button>
				<el-button type="info" @click="reset">重置</el-button>
				<el-button type="warning" @click="refresh">刷新</el-button>
			</div>
<!--			<div class="item w300">-->
<!--				<div class="label">-->
<!--					商店名称-->
<!--				</div>-->
<!--				<div class="input">-->
<!--					<el-input v-model="shop_name" placeholder="请输入内容"></el-input>-->
<!--				</div>-->
<!--			</div>-->
<!--			<div class="item w300">-->
<!--				<div class="label">-->
<!--					名称-->
<!--				</div>-->
<!--				<div class="input">-->
<!--					<el-select v-model="value" placeholder="请选择">-->
<!--						<el-option-->
<!--								v-for="item in options"-->
<!--								:key="item.value"-->
<!--								:label="item.label"-->
<!--								:value="item.value">-->
<!--						</el-option>-->
<!--					</el-select>-->
<!--				</div>-->
<!--			</div>-->



		</div>


		<div class="headers">
			<div class="item">
				<div class="div1">
					订单序号
				</div>
				<div class="div">
					门店信息板块
				</div>
				<div class="div">
					订单信息板块
				</div>
				<div class="div">
					订单状态
				</div>
				<div class="div5">
					操作
				</div>

			</div>
<!--			<div class="item">-->
<!--				<div class="div">-->
<!--					门店信息板块-->
<!--				</div>-->
<!--				<div class="div">-->
<!--					订单信息板块-->
<!--				</div>-->
<!--			</div>-->
		</div>
		<div class="list">
			<div class="item" v-for="(item,index) in list" :key="index">
				<div v-if="item.status==0" class="status">
					待处理
				</div>
				<div v-else-if="item.status==1" class="status2">
					已审核
				</div>

				<div v-else-if="item.status==2" class="status3">
					已拒绝
				</div>
				<div v-else="item.status==0" class="status">
					待处理
				</div>

<!--				<div class="btn">-->
<!--					编辑-->
<!--				</div>-->


				<div class="sn">

					<div class="dd">
						{{item.id}}
					</div>

					<div class="dd">
						{{item.create_time}}
					</div>

<!--					<div class="dd" v-if="item.yys">中国{{item.yys}}</div>-->
					<div class="dd" >{{item.yys}}</div>
				</div>
				<div class="left">
					<div class="pp">
						<div class="title">
							门店名称
						</div>
						<div class="content">
							{{item.shop_name}}
						</div>
					</div>
					<div class="pp">
						<div class="title">
							门店姓名
						</div>
						<div class="content">
							{{item.s_people}}
						</div>
					</div>
					<div class="pp">
						<div class="title">
							联系电话
						</div>
						<div class="content">
							{{item.shop_phone}}
						</div>
					</div>
					<div class="pp">
						<div class="title">
							门店地址
						</div>
						<div class="content">
							{{item.province+item.city+item.area}}
						</div>
					</div>
					<div class="pp">
						<div class="title">
							业务员
						</div>
						<div class="content">
							{{item.sa_name}}
						</div>
					</div>
				</div>
				<div class="right">
					<div class="pp">
						<div class="title">
							套餐名称
						</div>
						<div class="content">
							{{item.package_name2}}
						</div>
					</div>
					<div class="pp">
						<div class="title">
							新入网号码
						</div>
						<div class="content">
							{{item.phone}}
						</div>
					</div>
<!--					<div class="pp">-->
<!--						<div class="title">-->
<!--							激活时间-->
<!--						</div>-->
<!--						<div class="content">-->
<!--							2024-07-11-->
<!--						</div>-->
<!--					</div>-->
					<div class="pp">
						<div class="title">
							首冲金额
						</div>
						<div class="content">
							{{item.sc_money}}
						</div>
					</div>
					<div class="pp">
						<div class="title">
							商家金额
						</div>
						<div class="content">
							{{Number(item.commission1)+Number(item.money1)}}
						</div>
					</div>
					<div class="pp">
						<div class="title">
							业务员金额
						</div>
						<div class="content">
							{{Number(item.commission2)+Number(item.money2)}}
						</div>
					</div>
				</div>

				<div class="right">
					<div class="pp">
						<div class="title">
							客服审核
						</div>

						<div v-if="item.kf_status==0" class="content" style="color: #0285DD;font-weight: bold;!important;">
							待审核
						</div>
						<div v-else-if="item.kf_status==1"  class="content" style="color: #00B83F;font-weight: bold;!important;">
							审核通过
						</div>
						<div v-else-if="item.kf_status==2" class="content" style="color: red;font-weight: bold;!important;">
							审核失败
						</div>
						<div v-else class="content" style="color: #0285DD;font-weight: bold;!important;">
							待审核
						</div>

					</div>
					<div class="pp">
						<div class="title">
							审核时间
						</div>
						<div class="content">
							{{item.kf_status_time}}
						</div>
					</div>
					<div class="pp">
						<div class="title">
							财务审核
						</div>
						<div v-if="item.cw_status==0" class="content" style="color: #0285DD;font-weight: bold;!important;">
							待审核
						</div>
						<div v-else-if="item.cw_status==1"  class="content" style="color: #00B83F;font-weight: bold;!important;">
							审核通过
						</div>
						<div v-else-if="item.cw_status==2" class="content" style="color: red;font-weight: bold;!important;">
							审核失败
						</div>
						<div v-else class="content" style="color: #0285DD;font-weight: bold;!important;">
							待审核
						</div>
					</div>
					<div class="pp">
						<div class="title">
							审核时间
						</div>
						<div class="content">
							{{item.cw_status_time}}
						</div>
					</div>
					<div class="pp">
						<div class="title">
							异常状态
						</div>
						<div v-if="item.yc" class="content" style="color: red;font-weight: bold;">
							{{ item.yc}}
						</div>
						<div v-else class="content">
							正常
						</div>
					</div>
				</div>


				<div class="cz">


					<div class="pp">
						<el-button  type="primary" size="small" @click="detail(item.id)">客服审核</el-button>

					</div>

					<div class="pp">

						<el-button  type="success" size="small" @click="detail2(item.id)">财务审核</el-button>

					</div>


					<div class="pp">
						<el-button v-if="item.is_yc==0" type="danger" size="small" @click="ycedit(item.id)">异常处理</el-button>

						<el-button v-if="item.is_yc==1" type="danger" size="small" @click="ycedit2(item.id)">异常信息</el-button>
					</div>


				</div>
			</div>
		</div>

		<div class="pages mt24">
			<el-pagination background layout="prev, pager, next" :page-size="10" @current-change="handleCurrentChange"
						   :total="total"></el-pagination>
		</div>
	</div>
</body>
{/block}

{block name="script"}
<script>
	const app = new Vue({
		el: '#app',
		data() {
			return {
				input: '',
				page:1,
				limit: 10,
				total: 0,
				list:[],
				options: [{
					value: 3,
					label: '未审核'
				}, {
					value: 1,
					label: '已审核'
				}, {
					value: 2,
					label: '审核失败'
				}
				],
				value: '',

				id:'',
				sale:'',
				shop_name:'',
				kf_status:'',
				cw_status:'',
				create_time:'',
				phone:'',
			}
		},
		mounted() {

			this.init()
		},
		beforeDestroy() {
			// this.stopAutoScroll();
		},
		computed: {},
		methods: {
			detail(id){
				wk.layer_showx('财务审核','{:url('kfstatus')}?id='+id ,1200,1000,1)
				// window.location.href =  "/admin/order.order/kfstatus?id="+id
			},
			detail2(id){
				 wk.layer_showx('财务审核','{:url('cwstatus')}?id='+id ,1200,1000,1);
			},

			ycedit(id){
				wk.layer_showx('异常处理','{:url('ycedit')}?id='+id ,1200,1000,1);
			},
			ycedit2(id){
				wk.layer_showx('异常信息','{:url('ycedit2')}?id='+id ,1200,1000,1);
			},

			reset(){
				this.id = ''
				this.shop_name = ''
				this.sale=''

				this.kf_status=''
				this.cw_status=''
				this.create_time=''
				this.phone=''

				this.page = 1
				this.init()
			},
			refresh(){
				this.init()
			},
			search(){
				this.page = 1
				this.init()
			},
			handleCurrentChange(val) {
				this.page = val
				this.init()
			},
			init(){
				HttpPost("/adminOrderList",{
					page:this.page,
					limit:this.limit,

					id:this.id,
					shop_name:this.shop_name,
					sale:this.sale,
					kf_status:this.kf_status,
					cw_status:this.cw_status,
					create_time:this.create_time,
					phone:this.phone,

				},(res)=>{
					if(res.code == 0){
						this.list =res.data.data
						this.total = res.data.total
					}

				})
			}
		},
	})



</script>
{/block}
